<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue2 test</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
  <input name = "username" v-model="username">{{username}}
  <input type="button" v-on:click="print" value="hello">
</div>
<script>
  new Vue({
    el:"#app",
    data(){
      return{
        username:""
      }
    },
    methods:{
      print(){
        alert(this.username)
      }
    }
  })
</script>
</body>
</html>